<?php  
		// This is a class which connect to the database  			
		require("../library/MySQL.dll.php");
		$db = new MySQL();    
		  parse_str($_POST['data']); 			 
		  for ($i = 0; $i < count($sortlist); $i++) { 			 
			 $sql = $db->update("UPDATE product_item SET orderId = $i WHERE id = $sortlist[$i]"); 				
			  //if ($sql) print 'Updating order went well'.$i;				   
		  }  			 
		  sleep(1); 
		 $db->close();  
?>  